package com.file.system.entity.business;


import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.file.system.entity.basic.WebBasic;

import javax.validation.constraints.*;
import javax.validation.constraints.Size;
import javax.validation.groups.Default;

import com.file.system.plugin.dict.Dict;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import com.file.system.plugin.validated.SQLInjectionValidation;


/**
 * 器具订单
 *
 * @author jch
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = false)
@JsonIgnoreProperties
public class BusUtensilIndent extends WebBasic implements Serializable {

    private static final long serialVersionUID = 1L;


    //新增
    public interface add extends Default {
    }

    //修改
    public interface update extends Default {
    }

    public interface sign extends Default {
    }

    /**
     * 主键
     */
    @NotNull(groups = {update.class, sign.class}, message = "主键不能为空")
    @Min(value = 1, message = "id长度最小1")
    private Long id;
    /**
     * 委托单号
     */
    @NotEmpty(groups = {update.class, add.class}, message = "委托单号不能为空")
    @SQLInjectionValidation(fieldName = "委托单号")
    private String regFormNo;
    /**
     * 委托单位名称/发票单位名称
     */
    @NotEmpty(groups = {update.class, add.class}, message = "委托单位名称/发票单位名称不能为空")
    @SQLInjectionValidation(fieldName = "委托单位名称/发票单位名称")
    private String nameOfEntrustOrg;
    /**
     * 单位地址
     */
    @SQLInjectionValidation(fieldName = "单位地址")
    private String addressOfEntrustOrg;
    /**
     * 联系人
     */
    @SQLInjectionValidation(fieldName = "联系人")
    private String contactPersonOfEntrustOrg;
    /**
     * 联系电话
     */
    @SQLInjectionValidation(fieldName = "联系电话")
    private String phoneOfEntrustOrg;
    /**
     * 证书单位名称
     */
    @NotEmpty(groups = {update.class, add.class}, message = "证书单位名称不能为空")
    @SQLInjectionValidation(fieldName = "证书单位名称")
    private String certificationCompany;
    /**
     * 单位地址
     */
    @SQLInjectionValidation(fieldName = "单位地址")
    private String address;
    /**
     * 联系人
     */
    @SQLInjectionValidation(fieldName = "联系人")
    private String linkman;
    /**
     * 联系电话
     */
    @SQLInjectionValidation(fieldName = "联系电话")
    private String linkPhone;
    /**
     * 委托日期
     */
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate entrustDate;
    /**
     * 受理日期
     */
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate acceptDate;
    /**
     * 受理人员
     */
    @SQLInjectionValidation(fieldName = "受理人员")
    private String accepterSign;
    /**
     * 签字内容
     */
    @NotEmpty(groups = {sign.class}, message = "签字内容不能为空")
    @Size(min = 1, message = "签字内容长度1")
    @SQLInjectionValidation(fieldName = "签字内容")
    private String signContent;
    /**
     * 签字时间
     */
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime signDate;
    /**
     * 签字状态（字典）（字典）
     */
    @Dict("signStatus")
    @SQLInjectionValidation(fieldName = "签字状态（字典）")
    private String dictSignStatus;

    /**
     * 下厂
     */
    @Dict("checkType")
    private String dictCheckType;
    /**
     * 器具数量
     */
    private Integer utensilCount;
    /**
     * 邮编
     */
    private String zipCode;

    public Integer getUtensilCount() {
        return utensilCount;
    }

    public void setUtensilCount(Integer utensilCount) {
        this.utensilCount = utensilCount;
    }
}
